package com.sofa.client;

import com.sofa.service.HelloSyncService;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.ImportResource;

import javax.annotation.Resource;

@ImportResource({ "classpath*:rpc-starter-example.xml" })
@SpringBootApplication
public class ClientApplication {



    public static void main(String[] args) {
//        SpringApplication.run(ClientApplication.class, args);
        SpringApplication springApplication = new SpringApplication(ClientApplication.class);
        ApplicationContext applicationContext = springApplication.run(args);

        HelloSyncService helloSyncServiceReference = (HelloSyncService) applicationContext
                .getBean("helloSyncServiceReference");

        System.out.println(helloSyncServiceReference.saySync("sync"));


    }

}
